﻿using MediatR;
using RBAC.Domain;
using RBAC.Domain.Service.Interfae;
using RBACDuYaJun.Api.Appliction.Command.UserCommand;

namespace RBACDuYaJun.Api.Appliction.CommandHandlers.UserHanders
{
    public class UserGetIdCommandHandler : IRequestHandler<UserGetIdCommand, UserInfo>
    {
        private readonly IUserService _userService;
        public UserGetIdCommandHandler(IUserService userService)
        {
            _userService = userService;
        }
        public async Task<UserInfo> Handle(UserGetIdCommand request, CancellationToken cancellationToken)
        {
            return await _userService.GetUserAll(new UserInfo() { userInfoId = request.UserId });
        }
    }
}
